package com.yanqu.road.server.cmd.cookboy;

import com.yanqu.road.pb.activity.CrossActivityRankProto;
import com.yanqu.road.pb.cookboyactivity.CookBoyActivityProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.CmdApi;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@CmdApi(reqMsg = CookBoyActivityProto.CookBoyActivityRankReqMsg.class, respMsg = CookBoyActivityProto.CookBoyActivityRankRespMsg.class)
@Cmd(code = Protocol.S_COOK_BOY_ACTIVITY_RANK_SELF, desc = "个人小当家排行")
public class CookBoyActivityRankCmd extends AbstractCommand {

    private int activityId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        CookBoyActivityProto.CookBoyActivityRankReqMsg reqMsg = CookBoyActivityProto.CookBoyActivityRankReqMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {

    }

    @Override
    public void sendData(GamePlayer player) {
        CrossActivityRankProto.CrossActivityRankReqMsg.Builder msg = CrossActivityRankProto.CrossActivityRankReqMsg.newBuilder();
        msg.setActivityId(activityId);
        msg.setBigRankType(0);
        player.sendPacket(Protocol.C2_CROSS_GET_RELATION_ACTIVITY_RANK_SELF, msg);
    }

}
